package com.example;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Author: wws
 * describe:
*/
public class WechatServer{
    public static void main(String[] args) {
        String javaStr = "060A04000000C2"; //十六进制
        byte [] bytes = {0x78 ,0x56 ,0x34 ,0x12};
        System.out.println(byteArrayToInt(bytes));

    }

    /**
     * byte[]转int
     * @param bytes 需要转换成int的数组
     * @return int值
     */
    public static int byteArrayToInt(byte[] bytes) {
        int value=0;
        for(int i = 0; i < 4; i++) {
            int shift= (3-i) * 8;
            value +=(bytes[i] & 0xFF) << shift;
        }
        return value;
    }
}
